package com.example.scenictourback.dto;

import com.example.scenictourback.entity.User;
import lombok.Data;

@Data
public class UserDTO {
    
    private Integer id;
    private String username;
    private String phone;
    private Integer role; // 1-游客, 2-管理员
    private Integer status; // 1-正常, 0-禁用
    
    public static UserDTO fromEntity(User entity) {
        UserDTO dto = new UserDTO();
        dto.setId(entity.getId());
        dto.setUsername(entity.getUsername());
        dto.setPhone(entity.getPhone());
        dto.setRole(entity.getRole());
        dto.setStatus(entity.getStatus());
        return dto;
    }
} 